package com.adcc.monitoragent.bean;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
 * 重要日志
 * 服务主备切换， 停止启动，状态变跟
 * 监控的工具状态变跟
 * ip+端口+服务名   定位到某个服务日志
 * @author charlie
 *
 */
public class ServiceLogBean implements Serializable {
	private static final long serialVersionUID = 1L;
	private long time;//时间
	private String lavel;//级别
	private String desc;//描述
	private String ip;//服务器ip
	private String port;//服务使用的端口
	private String serviceName;//服务名
	public static final String INFO = "INFO";
	public static final String WARN = "WARN";
	public static final String ERROR = "ERROR";
	public ServiceLogBean(String lavel, String desc, String ip,
			String port, String serviceName) {
		super();
		this.time = System.currentTimeMillis();
		this.lavel = lavel;
		this.desc = desc;
		this.ip = ip;
		this.port = port;
		this.serviceName = serviceName;
	}
	
	public ServiceLogBean() {
		super();
	}

	public long getTime() {
		return time;
	}
	public void setTime(long time) {
		this.time = time;
	}
	public String getLavel() {
		return lavel;
	}
	public void setLavel(String lavel) {
		this.lavel = lavel;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public String getPort() {
		return port;
	}
	public void setPort(String port) {
		this.port = port;
	}
	public String getServiceName() {
		return serviceName;
	}
	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}

	@Override
	public String toString() {
		String timet = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(time));
		return "ServiceLogBean [desc=" + desc + ", ip=" + ip + ", lavel="
				+ lavel + ", port=" + port + ", serviceName=" + serviceName
				+ ", time=" + timet + "]";
	}
	
}
